<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp" %>
  <%@ include file="/WEB-INF/include/submenu.jsp" %>

  <div class="container-fluid ms-container has-ms-sidemenu">
  
    <ol class="ms-breadcrumb breadcrumb">
        <li class="active">公司信息管理</li>
    </ol>
  
    <div class="ms-content-layout">

      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/supplier-status-fragment.jsp" %>
      
      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/supplier-declaration-info-fragment.jsp" %>
      
      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/supplier-certificate-fragment.jsp" %>
      
      <div id="anchor-trans-supplier" class="block-heading">
         <h5>运输供方资源信息</h5>
         <c:if test="${supplierMenuType != 'sub'}">
           <a href="${ctx.host}/suppliers/${supplier.id}/trans-supplier/edit?panel=true" data-target="#edit" data-toggle="modal" title="Edit" class="pull-right"
              style="font-size: 12px; padding-top: 20px;">编辑</a>
         </c:if>
      </div>
      
      <div class="form-horizontal ms-form form-personal-info form-supplier-info">

        <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">25&nbsp;<span class="color-red">*</span>单车月行驶公里数：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${transSupplier.monthlyMileage}</p>
          </div>
        
         <label class="control-label col-xs-3 ">26&nbsp;<span class="color-red">*</span>单车重载率：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${transSupplier.heavyLoadRate}</p>
          </div>
         </div>
        
         <div class="form-group ms-form-group">
          <label class="control-label col-xs-3 ">27.1&nbsp;<span class="color-red">*</span>GPS安装情况：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${transSupplier.gpsDescription}</p>
          </div>
          
          <label class="control-label col-xs-3 ">27.2&nbsp;<span class="color-red">*</span>GPS是否和安吉物流GPS平台兼容：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">${transSupplier.compatible ? '是' : '否'}</p>
          </div>
         </div>
        
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">28&nbsp;<span class="color-red">*</span>运输工具保险：</label>
          <div class="col-xs-3 pull-left">
            <p class="form-control-static">
              <c:choose>
                <c:when test="${empty transSupplier.vehicleInsurance and supplierMenuType == 'sub'}">暂未上传</c:when>
                <c:when test="${not empty transSupplier.vehicleInsurance and supplierMenuType == 'sub'}">
                  <a href="${transSupplier.vehicleInsurance}" download="${supplier.name}运输工具保险">运输工具保险</a>
                </c:when>
                <c:when test="${empty transSupplier.vehicleInsurance and supplierMenuType != 'sub'}">
                  暂未上传，点击按钮上传
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/trans-supplier/upload?type=vehicleInsurance&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
                </c:when>
                <c:otherwise>
                  <a href="${transSupplier.vehicleInsurance}" download="${supplier.name}运输工具保险">运输工具保险</a>
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/trans-supplier/upload?type=vehicleInsurance&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
                </c:otherwise>
              </c:choose>
            </p>
          </div>
       </div>

      <div class="form-group  ms-form-group">
        <label class="control-label col-xs-4">29&nbsp;<span class="color-red">*</span>GPS&TSS手持设备配备承诺书/购买合同：</label>
        <div class="col-xs-4 pull-left">
            <p class="form-control-static">
              <c:choose>
                <c:when test="${empty transSupplier.purchaseContract and supplierMenuType == 'sub'}">暂未上传</c:when>
                <c:when test="${not empty transSupplier.purchaseContract and supplierMenuType == 'sub'}">
                  <a href="${transSupplier.purchaseContract}" download="${supplier.name}GPS&TSS手持设备配备承诺书/购买合同">GPS&TSS手持设备配备承诺书/购买合同</a>
                </c:when>
                <c:when test="${empty transSupplier.purchaseContract and supplierMenuType != 'sub'}">
                  暂未上传，点击按钮上传
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/trans-supplier/upload?type=purchaseContract&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
                </c:when>
                <c:otherwise>
                  <a href="${transSupplier.purchaseContract}" download="${supplier.name}GPS&TSS手持设备配备承诺书/购买合同">GPS&TSS手持设备配备承诺书/购买合同</a>
                  <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/trans-supplier/upload?type=purchaseContract&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
                </c:otherwise>
              </c:choose>
              <a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.resource}/template/supplier/tracking-equipment-commitment.doc" download="跟踪设备配备承诺书">承诺书模板</a>
            </p>
        </div>
      </div>
    </div>
      
      <jsp:include page="/WEB-INF/jsps/supplier/profile/profile-view-fragment/business-history-fragment.jsp">
        <jsp:param name="type" value="trans"/>
      </jsp:include>
      
      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/parking-resource-fragment.jsp" %>
      
      <%@ include file="/WEB-INF/jsps/supplier/profile/profile-view-fragment/supplier-staff-fragment.jsp" %>
       
      <div id="anchor-trasnport-resource" class="block-heading">
         <h5>运力资源</h5>
      </div>
      
      <div class="small-title" style="margin-top: 10px;">1&nbsp;牵引车</div>
        
      <table class="table table-hover ms-table ">
        <thead>
          <tr>
            <c:forEach items="${enums['PropertyType']}" var="property">
              <th>${property.description}</th>
            </c:forEach>
            <th>合计</th>
            <c:if test="${supplierMenuType != 'sub'}">
              <th>操作</th>
            </c:if>
          </tr>
        </thead>
        
        <tbody>
          <tr>
              <c:set var="displayVehicle" value="false" />
               <c:forEach items="${transSupplierVehicleStats}" var="transSupplierVehicleStat" > 
                  <c:if test="${transSupplierVehicleStat.vehicleType.alias eq 'truck'}">
                    <c:set var="sum" value="${sum + transSupplierVehicleStat.amount}"/>
                    <td>${empty transSupplierVehicleStat.amount ? '0' : transSupplierVehicleStat.amount}</td>
	                  <c:set var="displayVehicle" value="true" />
                  </c:if>
                </c:forEach>
                
               <c:if test="${not displayVehicle}">
                 <td>无</td>
                 <td>无</td>
                 <td>无</td>
                 <td>无</td>
                 <td>无</td>
                 <td>无</td>
              </c:if>
              
              <td>${empty sum ? '0':sum}</td>
              
              <c:set var="sum" value="0"/>
              
              <c:if test="${supplierMenuType != 'sub'}">
                <td>
                  <a href="${ctx.host}/suppliers/${supplier.id}/trans-vehicle-stat/${not displayVehicle? 'create':'edit'}?vehicle=true" data-target="#edit" data-toggle="modal">${not displayVehicle? '新建':'编辑'}</a>&nbsp;&nbsp;
                </td>
              </c:if>
          </tr>
        </tbody>
      </table>
        
      <div class="small-title" style="margin-top: 10px;">2&nbsp;挂车类型及装载量</div>
      
	      <table class="table table-hover ms-table">
	        <thead>
	          <tr>
	            <th style="width:15%;">挂车类型\装载量</th>
		            <c:forEach items="${enums['CapacityType']}" var="capacityType" > 
		              <th>${capacityType.description}</th>
		            </c:forEach>
	            <th>合计</th>
	            <c:if test="${supplierMenuType != 'sub'}">
	              <th>操作</th>
	            </c:if>
	          </tr>
	        </thead>
	        
	        <tbody>
	        
	          <c:forEach items="${enums['SupplierTrailerType']}" var="trailer">
	           
	            <c:set var="display" value="false" />
	            
	            <c:if test="${trailer.one}">
	              <tr>
	              
	               <td>${trailer.description}</td>
	                  
	                <c:forEach items="${transSupplierVehicleStats}" var="transSupplierVehicleStat"> 
	                  
	                  <c:if test="${trailer.alias eq transSupplierVehicleStat.trailerType.alias and transSupplierVehicleStat.trailerType.one}">
	                    <td>${transSupplierVehicleStat.capacityTypeOne}</td>
	                    <td>${transSupplierVehicleStat.capacityTypeTwo}</td>
	                    <td>${transSupplierVehicleStat.capacityTypeThree}</td>
	                    <td>${transSupplierVehicleStat.capacityTypeFour}</td>
	                    <td>${transSupplierVehicleStat.capacityTypeFive}</td>
	                    <td>${transSupplierVehicleStat.capacityTypeSix}</td>
	                    <td>${transSupplierVehicleStat.capacityTypeSeven}</td>
	                    <td>${transSupplierVehicleStat.capacityTypeEight}</td>
	                    <td>${transSupplierVehicleStat.capacityTypeNine}</td>
	                    <td>${transSupplierVehicleStat.capacityTypeOther}</td>
	                    <td>${transSupplierVehicleStat.totals}</td>
	                    <c:set var="display" value="true" />
	                  </c:if>
	                  
	                </c:forEach>
	                 
	                <c:if test="${not display}">
	                  <td>无</td>
	                  <td>无</td>
	                  <td>无</td>
	                  <td>无</td>
	                  <td>无</td>
	                  <td>无</td>
	                  <td>无</td>
	                  <td>无</td>
	                  <td>无</td>
	                  <td>无</td>
	                  <td>0</td>
	                </c:if> 
	                  
	                <c:if test="${supplierMenuType != 'sub'}">
	                  <td>
	                    <a href="${ctx.host}/suppliers/${supplierId}/trans-vehicle-stat/${not display? 'create':'edit'}?trailer=true&&trailerType=${trailer.alias}" data-target="#edit" data-toggle="modal">${not display? '新建':'编辑'}</a>&nbsp;&nbsp;
	                  </td>
	                </c:if>
	                
	             </tr>
	           </c:if>
	           
	         </c:forEach>
	         
	        </tbody>
	      </table>
      
      <div class="small-title" style="margin-top: 10px;">3&nbsp;其他运力资源</div>
      <table class="table table-hover ms-table ">
        <thead>
          <tr>
            <c:forEach items="${enums['SupplierTrailerType']}" var="trailer">
              <c:if test="${trailer.code eq 'Two'}">
                <th>${trailer.description}</th>
              </c:if>
            </c:forEach>
            <c:if test="${supplierMenuType != 'sub'}">
              <th>操作</th>
            </c:if>
          </tr>
        </thead>
        <tbody>
          <tr>
              <c:set var="displayOther" value="false" />
               <c:forEach items="${transSupplierVehicleStats}" var="transSupplierVehicleStat" > 
                  <c:if test="${transSupplierVehicleStat.trailerType.code eq 'Two'}">
                     <td>
                      ${empty transSupplierVehicleStat.amount ? '0':transSupplierVehicleStat.amount}
                     </td>
                     <c:set var="displayOther" value="true" />
                  </c:if>
                </c:forEach>
                
               <c:if test="${not displayOther}">
                 <td>无</td>
                 <td>无</td>
                 <td>无</td>
                 <td>无</td>
              </c:if>
              <c:if test="${supplierMenuType != 'sub'}">
                <td>
                  <a href="${ctx.host}/suppliers/${supplier.id}/trans-vehicle-stat/${not displayOther? 'create' : 'edit'}?other=true" data-target="#edit" data-toggle="modal">${not displayOther? '新建':'编辑'}</a>&nbsp;&nbsp;
                </td>
              </c:if>
          </tr>
        </tbody>
      </table>
  
    <div class="block-heading">
      <h5>申请人上传部分(管理公司)</h5>
    </div>

    <div class="form-horizontal ms-form form-personal-info">
      
      <div class="form-group  ms-form-group">
       <label class="control-label col-xs-3">30&nbsp;<span class="color-red">*</span>备选供应商引入评审上传：</label>
       <div class="col-xs-8 pull-left upload-cover">
         <c:choose>
           <c:when test="${empty recommendation.introduceForm and supplierMenuType != 'editing'}">暂未上传</c:when>
           <c:when test="${not empty recommendation.introduceForm and supplierMenuType != 'editing'}">
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.introduceForm}" download="备选供应商引入评审">备选供应商引入评审</a>
           </c:when>
           <c:when test="${empty recommendation.introduceForm and supplierMenuType eq 'editing'}">
             暂未上传，点击按钮上传
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=introduceForm&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
           </c:when>
           <c:when test="${not empty recommendation.introduceForm and supplierMenuType eq 'editing'}">
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.introduceForm}" download="备选供应商引入评审">备选供应商引入评审</a>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=introduceForm&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
           </c:when>
         </c:choose>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${ctx.resource}/template/supplier/supplier-introduce-form.docx" download="“备选”物流供应商引入评审申报表">备选供应商引入评审模板</a>
       </div>
      </div>

      <div class="form-group  ms-form-group">
        <label class="control-label col-xs-3">31&nbsp;<span class="color-red">*</span>现场评审得分结果上传：</label>
        <div class="col-xs-8 pull-left upload-cover">
         <c:choose>
           <c:when test="${empty recommendation.assessment and supplierMenuType != 'editing'}">暂未上传</c:when>
           <c:when test="${not empty recommendation.assessment and supplierMenuType != 'editing'}">
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.assessment}" download="现场评审得分结果">现场评审得分结果</a>
           </c:when>
           <c:when test="${empty recommendation.assessment and supplierMenuType eq 'editing'}">
             暂未上传，点击按钮上传
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=assessment&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
           </c:when>
           <c:when test="${not empty recommendation.assessment and supplierMenuType eq 'editing'}">
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.assessment}" download="现场评审得分结果">现场评审得分结果</a>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=assessment&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
           </c:when>
         </c:choose>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${ctx.resource}/template/supplier/supplier-assessment.xls" download="现场评审得分结果模板-运输">现场评审得分结果模板</a>
       </div>
      </div>

      <div class="form-group  ms-form-group">
          <label class="control-label col-xs-3">32&nbsp;<span class="color-red">*</span>推荐函上传：</label>
          <div class="col-xs-8 pull-left upload-cover">
         <c:choose>
           <c:when test="${empty recommendation.recommendation and supplierMenuType != 'editing'}">暂未上传</c:when>
           <c:when test="${not empty recommendation.recommendation and supplierMenuType != 'editing'}">
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.recommendation}" download="推荐函">推荐函</a>
           </c:when>
           <c:when test="${empty recommendation.recommendation and supplierMenuType eq 'editing'}">
             暂未上传，点击按钮上传
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=recommendation&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">上传</a>
           </c:when>
           <c:when test="${not empty recommendation.recommendation and supplierMenuType eq 'editing'}">
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${recommendation.recommendation}" download="推荐函">推荐函</a>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn ms-btn btn-primary" style="padding: 1px 5px;" href="${ctx.host}/suppliers/${supplier.id}/recommendation/${recommendation.id}/upload?type=recommendation&supplierMenuType=${param.supplierMenuType}" data-target="#upload" data-toggle="modal">重新上传</a>
           </c:when>
         </c:choose>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="${ctx.resource}/template/supplier/supplier-vehicle-recommendation.docx" download="整车物流供应商推荐说明">推荐函模板</a>
       </div>
      </div>
  </div>
</div>

<%@ include file="/WEB-INF/include/script.jsp" %>
<d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/management/supplier-info-view.js"/>
<script type="text/javascript">
    require(['page/supplier/management/supplier-info-view'], function (page) {
        page.init()
    })
</script>

</body>
</html>
